package com.atguigu.util.homework1;

/**
 * @author caesar
 * @date 2025/7/4
 * @apiNote
 */
public class MyArraysTest {
    public static void main(String[] args) {
        int[] arr = {1, 2, 10, 4, 5, 10, 7, 8, 9, 10};
        System.out.println("arr数组：" + MyArrays.toString(arr));
        System.out.println("所有元素之和：" + MyArrays.sum(arr));
        System.out.println("最大值：" + MyArrays.max(arr));
        System.out.println("最小值：" + MyArrays.min(arr));
        System.out.println("元素10首次出现的位置：" + MyArrays.indexOf(arr, 10));
        System.out.println("元素10最后1次出现的位置：" + MyArrays.lastIndexOf(arr, 10));
        System.out.println("元素10总共出现：" + MyArrays.valueCount(arr, 10) + "次");
        MyArrays.sort(arr);
        System.out.println("从小到大排序：" + MyArrays.toString(arr));
        MyArrays.reverse(arr, 0, arr.length);
        System.out.println("反转数组");
        System.out.println("从大到小排序：" + MyArrays.toString(arr));

    }

}
